#!/bin/bash

#set -e
pushd /
(
for i in /patches/webrsync/*.patch ; do 
  #patch -Np1 -i /home/zazdxscf/patches/webrsync/notify_when_patches_folder_inaccessible_by_portage.patch
  patch -Np1 -i "$i"
  ec="$?"
  if test "$ec" -ne "0"; then
    echo "FAILED!" | grep --color=tty "FAIL"
  fi
done
)

#get chromium required disk space down from 25G to 15G (14G required; with du -c -s --si -P after compiled but killed when ld-ing, and exe is over 3G so, might be more needed!)
#ok after 'Completed installing' emerge msg, I measured(with the above df) 21G
#CHECKREQS_DISK_BUILD="25G"
#/usr/portage/www-client/chromium/chromium-*.ebuild
sed -e 's/CHECKREQS_DISK_BUILD="25G"/CHECKREQS_DISK_BUILD="22G"/g' --in-place=.sed /usr/portage/www-client/chromium/chromium-*.ebuild

popd
:

